<!DOCTYPE HTML>
<html>
<head>
	<title>{$MenuName}</title>
	<include file="./Public/tpl/user/meta.html" />
	<style>
		.datatable img{ width: 80px; border:0px solid #ccc;} 
		.datatable .FavoriteTime{ margin-top:5px; color:#ccc; font-size:12px;}
		.datatable .DiscountPrice{ color:#FF0000; margin-top:5px;font-size:12px; }
	</style>
</head>
<body id="index" class="webapp notabbar">
	<include file="./Public/tpl/user/header.html" />
    <notempty name="Favorite">
            <table class="datatable">
                <thead>
                    <tr>
                        <th style="width:80px;">图片</th>
                        <th>标题</th>
                        <th style="width:55px;">操作</th>
                    </tr>
                </thead>
                <tbody>
                    <volist name="Favorite" id="f">
                        <tr id="row{$f.FavoriteID}">
                            <td><a href="{$f.InfoUrl}"><img src="{$f.InfoPicture|DefaultPicture}" /></a></td>
                            <td style="text-align:left;">
                                <div><a href="{$f.InfoUrl}">{$f.InfoTitle}</a></div>
                                <p>
                                    <gt name="f.DiscountPrice" value="0"><div class="DiscountPrice">{$CurrencySymbol}{$f.DiscountPrice}</div></gt>
                                    <div class="FavoriteTime">{$f.FavoriteTime|strtotime|yd_friend_date}</div>
                                </p>
                            </td>
                            <td><a onClick="del({$f.FavoriteID})" href="javascript:void(0)" class="btnDel">删除</a></td>
                        </tr>
                    </volist>
                </tbody>
            </table>
    <else/>
            <div class="weui-msg">
                <div class="weui-msg__icon-area"><i class="weui-icon-info weui-icon_msg"></i></div>
                <div class="weui-msg__text-area">
                    <p class="weui-msg__desc">{$Think.lang.NoInformation}</p>
                </div>
            </div>
    </notempty>
</body>
</html>
<script>
	function del(id){
		$.confirm("确定删除吗?", function() {
			LoadBox();
			var url = "{$Url}delFavorite";
			var p = {"id": id};
			$.get(url, p,function(data){
				CloseLoadBox();
				if (data.status == 1){
					$("#row"+id).remove();
				}else{ 
					ErrorBox(data.info);
				}	
			}, "json");
		});
	}
	
	function GoBack(){
		location.href = "{$Url}index";
	}
</script>